Skip to content

fix: handle archived repositories during collaborator reconciliation - #38

Merged
pierinho13 merged 1 commit into
mainfrom
fixing_service_monitor_no_tied_prometheus
Aug 9, 2026
Merged

fix: handle archived repositories during collaborator reconciliation#38
pierinho13 merged 1 commit into
mainfrom
fixing_service_monitor_no_tied_prometheus

Conversation

@pierinho13

Copy link
Copy Markdown
Owner

Summary

Handle archived GitHub repositories gracefully during collaborator reconciliation.

Archived repositories are read-only in GitHub, so collaborator mutations return 403 and previously caused repeated reconciliation errors and retries.

Changes

  • Detect archived repositories before attempting collaborator mutations.
  • Skip collaborator create/update operations when the repository is archived.
  • Set the resource condition to:
    • Ready=False
    • Reason=RepositoryArchived
  • Requeue without returning an error, avoiding controller-runtime error backoff and repeated 403 logs.
  • Handle the GitHub archived-repository 403 as a fallback in case the repository is archived between the initial read and the mutation.
  • Preserve Revoke deletion semantics by keeping the finalizer until the repository becomes writable again.
  • Add tests covering archived repository reconciliation and error classification.

Behavior

For an archived repository:

desired collaborator change
        ↓
repository archived
        ↓
mutation skipped
        ↓
Ready=False
Reason=RepositoryArchived
        ↓
scheduled requeue
        ↓
no reconciliation error

@pierinho13
pierinho13 merged commit b3c3944 into main Aug 9, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant